home *** CD-ROM | disk | FTP | other *** search
- /*********
- *
- * FILESIZE.C
- *
- * by Ralph Davis
- *
- * Placed in the public domain by Tom Rettig Associates, 10/22/1990.
- *
- * SYNTAX: FILESIZE( <expC> )
- *
- * PARAMETERS: <expC> = filespec, optionally including
- * drive, path, filename, and extension.
- *
- * RETURNS: Size of file in bytes.
- *
- *********/
-
- #include "trlib.h"
-
- TRTYPE filesize()
- {
- char *filename = _parc(1);
-
- if (PCOUNT == 1 && ISCHAR(1))
- {
- /* No wildcards in filename */
-
- if ((_tr_stpchr( filename, (char) '*') == 0L)
- && (_tr_stpchr( filename, (char ) '?') == 0L))
- _retnl( _tr_fs( filename ) );
- else
- _retnl(ERRORNEGL);
- }
- else
- _retnl(ERRORNEGL);
-
- return;
- }
-
-